package com.farm.mapper;

import com.farm.annotation.AutoFill;
import com.farm.entity.GiftGoods;
import com.farm.enumeration.OperationType;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @FileName GiftGoodsMapper
 * @Description
 * @Author Sword
 * @date 2025-02-25
 **/

@Mapper
public interface GiftGoodsMapper {

    /**
     * 根据GoodsIds查询GiftIds
     *
     * @param goodsIds
     * @return
     */
    List<Long> getGiftIdsByGoodsIds(List<Long> goodsIds);

    /**
     * 批量插入礼盒商品数据
     *
     * @param giftGoods
     */
    void saveBatch(List<GiftGoods> giftGoods);

    /**
     * 根据礼盒id查询礼盒商品
     * @param giftId
     * @return
     */
    @Select("select * from gift_goods where gift_id = #{giftId};")
    List<GiftGoods> getGiftGoodsByGiftId(Long giftId);

    /**
     * 根据礼盒id删除礼盒商品
     * @param giftId
     */
    @Delete("delete from gift_goods where gift_id = #{giftId};")
    void deleteByGiftId(Long giftId);
}
